package com.demo.spring.di.annotations;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 注入测试类
 *
 * @author Nina
 * @create 2018/8/29 下午7:37
 */
public class InjectMain {

    /**
     * AnnotationConfigApplicationContext作为容器，接收一个配置类作为参数
     * @param args
     */
    public static void main(String[] args) {
        AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(DiConfig
                .class);
        Bean1 bean1 = configApplicationContext.getBean(Bean1.class);
        bean1.sayHello();
    }
}
